package org.cloud.apis;

import io.swagger.v3.oas.annotations.Operation;
import org.cloud.apis.fallback.PayFeignSentinelApiFallBack;
import org.cloud.model.dto.PayDto;
import org.cloud.response.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * ClassName: AliPaymentFeign
 * Package: org.cloud.apis
 * Description:
 *
 * @Author: @weixueshi
 * @Create: 2024/4/13 - 14:57
 * @Version: v1.0
 */
@FeignClient(name = "cloud-payment-service",fallback = PayFeignSentinelApiFallBack.class)
public interface AliPaymentFeign {
    @PostMapping("/pay/add")
    ResultData addPayment(@RequestBody PayDto payDto);

    /**
     * 查询支付接口
     * @param orderNo
     * @return
     */
    @GetMapping("/pay/query/{orderNo}")
    ResultData queryOrder(@PathVariable("orderNo") String orderNo);

    /**
     * sentinel哨兵监控测试
     * @param orderNo
     * @return
     */
    @GetMapping("/pay/sentinel/get/{orderNo}")
    ResultData getPayByOrderNo(@PathVariable("orderNo") String orderNo);
}
